<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css选择器</title>
    <style>
        /* 1. 标签选择器 */
        /* div {
            color: red;
        }
        p {
            color: blue;
        }
        h1 {
            color: green;
        } */

        /* 2. 类选择器 */
        .red {
            color: red;
        }
        .green {
            color: green;
        }

        /* 3. id选择器 */
        #p1 {
            color: brown;
        }
    </style>
</head>
<body>
    <!-- <h1>一级标题</h1>
    <div>我是div1</div>
    <div>我是div2</div>
    <p>我是p标签1</p>
    <p>我是p标签2</p> -->

    <h1>一级标题</h1>
    <div class="red">我是div1</div>
    <divc class="green">我是div2</div>
    <p class="red" id="p1">我是p标签1</p>
    <p class="green">我是p标签2</p>
</body>
</html>